package cuit.blog.entity;


import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;

@Entity
@Table(name="t_reply")
public class Reply extends BaseEntity {
	@Column(name = "content")
    private String content;
    @ManyToOne(cascade=CascadeType.REFRESH,fetch=FetchType.EAGER)
    @JoinColumn(name = "article_id", referencedColumnName = "id")
    private Article article;

    @ManyToOne(cascade=CascadeType.REFRESH,fetch=FetchType.EAGER)
    @JoinColumn(name = "user_id", referencedColumnName = "id")
    private User user;
    
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
	@Override
	public String toString() {
		return "Reply [content=" + content + ", article=" + article + "]";
	}
    
    
    
}
